package inc.veluvana.weatherforecaster

/**
 *
 * @author eduarc (Eduar Castrillo)
 */
class Hardwood {
  
  /* type of this Hardwood */
  def type
  /* Unit price for this Hardwood */
  def unitPrice
  /* DeliveryTime for this Hardwood */
  def deliveryTime
  /* Cannonical name for this Hardwood */
  def cannonicalName
  
  /* Predefined Standard Hardwoods*/
  static final CHERRY           = new Hardwood(0, 5.95, 0.5, "cherry")
  static final CURLY_MAPLE      = new Hardwood(1, 6.00, 1.5, "curly_maple")
  static final GENUINE_MAHOGANY = new Hardwood(2, 9.60, 3.0, "genuine_mahogany")
  static final WENGE            = new Hardwood(3, 22.35, 5.0, "wenge")
  static final WHITE_OAK        = new Hardwood(4, 6.70, 1.0, "white_oak")
  static final SAWDUST          = new Hardwood(5, 1.5, 0, "sawdust")
  
  /**
   * Construct a new instance if hardwood
   * 
   * @param type
   * @param unitPrice
   * @param cannonicalName
   */
  Hardwood(type, unitPrice, deliveryTime, cannonicalName) {
    
    this.type = type
    this.unitPrice = unitPrice
    this.deliveryTime = deliveryTime
    this.cannonicalName = cannonicalName
  }
  
  /** Value use to index in the map */
  int hashCode() {
    type
  }
}

